﻿using System;
using System.Linq;


class Program
{
    static void Main()
    {
        string number = Console.ReadLine();

        Console.WriteLine(Convert.ToString(Convert.ToInt32(number, 2), 16));
    }
}

